<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-flight__orderpassenger}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission('flight:orderpassenger:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission('flight:orderpassenger:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="id" label="主键" header-align="center" align="center"></el-table-column>
        <el-table-column prop="orderNo" label="订单编号" header-align="center" align="center"></el-table-column>
        <el-table-column prop="psgNo" label="乘机人编号 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="psgName" label="乘客姓名，英文名字或拼音需在姓与名之间加上“/”，如“zhou/jielun” 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="psgType" label="乘机人类型 1成人 2儿童 3婴儿 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="cardType" label="证件类型，1-身份证 2-护照5-台胞证 7-回乡证 8-军官证 9-其他，10-外国人永久居留证，14-港澳居民居住证，15-台湾居民居住证 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="cardNo" label="证件号码 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="mobile" label="手机号码 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="birthday" label="出生日期 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="personPrice" label="账单价 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="personAirportTax" label="机建 必须" header-align="center" align="center"></el-table-column>
        <el-table-column prop="personTaxPrice" label="燃油" header-align="center" align="center"></el-table-column>
        <el-table-column prop="gender" label="性别，1-男，2-女" header-align="center" align="center"></el-table-column>
        <el-table-column prop="countryCode" label="国籍，国家二字码，除身份证、港澳居民居住证、台湾居民居住证外其他证件类型必传" header-align="center" align="center"></el-table-column>
        <el-table-column prop="countryName" label="国籍名称，除身份证、港澳居民居住证、台湾居民居住证外其他证件类型必传" header-align="center" align="center"></el-table-column>
        <el-table-column prop="issCountryCode" label="发证国家二字码，，除身份证、港澳居民居住证、台湾居民居住证外其他证件类型必传" header-align="center" align="center"></el-table-column>
        <el-table-column prop="issCountryName" label="发证国家名称，，除身份证、港澳居民居住证、台湾居民居住证外其他证件类型必传" header-align="center" align="center"></el-table-column>
        <el-table-column prop="cardExpireDate" label="证件有效期，格式为yyyy-MM-dd，，除身份证、港澳居民居住证、台湾居民居住证外其他证件类型必传" header-align="center" align="center"></el-table-column>
        <el-table-column prop="personSalePrice" label="应收金额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="personSaleServicePrice" label="技术服务费" header-align="center" align="center"></el-table-column>
        <el-table-column prop="personSupRealAmount" label="实收金额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="commisionPoint" label="返点" header-align="center" align="center"></el-table-column>
        <el-table-column prop="commisionMoney" label="定额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="creator" label="创建者" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createDate" label="创建时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updator" label="更新人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updateDate" label="更新时间" header-align="center" align="center"></el-table-column>
        <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
          <template slot-scope="scope">
            <el-button v-if="$hasPermission('flight:orderpassenger:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
            <el-button v-if="$hasPermission('flight:orderpassenger:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './orderpassenger-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/flight/orderpassenger/page',
        getDataListIsPage: true,
        exportURL: '/flight/orderpassenger/export',
        deleteURL: '/flight/orderpassenger',
        deleteIsBatch: true
      },
      dataForm: {
        id: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
